package com.example.big_event.pojo.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@NoArgsConstructor
@AllArgsConstructor
@Data
@TableName("article")
// 这是文章实体类，对应数据库中的 article
public class Article {
    //主键ID
    private Integer id;
    //文章标题
    private String title;

    //文章内容
    private String content;

    //封面图像
    private String coverImg;

    //发布状态 已发布|草稿
    private String state;

    //文章分类id
    private Integer categoryId;

    //创建人ID
    private Integer createUser;


    //创建时间
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    //修改时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
